<?php

class MasterView{
	private $carset;
	private $styleSheetTag = null;
	
	public function __construct($charset = 'utf-8'){
		$this->carset = $charset;
	}
	//skapar css link tag
	public function AddCSS($cssFile){
		$this->styleSheetTag = "<link href='$cssFile' rel='stylesheet' type='text/css' media='screen'>";
	}
	//returnerar html för sidor som kräver inloggning
	public function UserUnauthorisedBox(){
		$html = "<div class='wrapper'>
						<div>
							You have to be logged in to use this feature you have to be logged in, please login to your right or click <a href='?".NavView::$getPageKey."=".Action::USER_REGISTER."'>here</a> to create an account.
						</div>
					</div>";	
		return $html;
	}
	//returnerar komplett html sida baserat på inparametrar menu, body och sidebar
	public function GetHTMLPage($menu = '', $body = '', $sidebar = ''){
		$html ="<html>
				  <head>
				    <meta http-equiv='content-type' content='text/html; charset=$this->carset' />
				    $this->styleSheetTag
				    <title></title>
				  </head>
				  <body>
					<div id='container'>
						<div id='header'>
							<div id='logo'></div>
						</div>
						<div id='main'>
								$menu
							<div id='content'>
								<div id='body'>$body</div>
								<div id='sidebar'>
									<div class='wrapper'>
										$sidebar
									</div>
								</div>
								<div class='clear'></div>	
							</div>
						</div>
					</div>
				  </body>
				</head>";
		return $html;
	}
}
?>